import {createRouter, createWebHashHistory} from "vue-router"
import Login from '@/components/Login.vue'
import Index from '@/components/Index.vue'
import Dashboard from '@/components/pages/Dashboard.vue'

import SysUser from "@/components/pages/system/SysUser";
import SysOrg from "@/components/pages/system/SysOrg";
import SysMenu from "@/components/pages/system/SysMenu";
import SysRole from "@/components/pages/system/SysRole";
const routes = [
    {
        path: "/",
        name: "Login",
        component:Login,
    },
    {
        path: "/",
        name: "Index",
        component:Index,
        children: [
            {
                path: 'index',
                name: 'Dashboard',
                component:Dashboard
            },
            {
                path: 'sys/user',
                name: 'SysUser',
                component: SysUser
            },
            {
                path: 'sys/org',
                component: SysOrg
            },
            {
                path: 'sys/menu',
                component: SysMenu
            },
            {
                path: 'sys/role',
                component: SysRole
            }
        ]
    }

];
const router = createRouter({
    // 4. 采用hash 模式
    history: createWebHashHistory(),
    // 采用 history 模式
    // history: createWebHistory(),
    routes, // short for `routes: routes`
});
export default router
